package com.oilsection.demo.controller;

import com.oilsection.demo.po.KqInfoTable;
import com.oilsection.demo.entity.specKqInfo;
import com.oilsection.demo.entity.specKqPointInfo;
import com.oilsection.demo.service.QkListService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author yangyuge
 * @description
 * @Date 2024/5/3 16:08
 */
@Slf4j
@RestController
public class QkListController {
    @Resource
    private QkListService qkListService;

    @CrossOrigin
    @GetMapping("/getQkList")
    public List<KqInfoTable> getQkList() {
        return qkListService.getQkList();
    }

    @CrossOrigin
    @GetMapping("/getSpecKqInfo")
    public Map<String, specKqInfo> getSpecKqInfo(String id) {
        return qkListService.getSpecKqInfo(id);
    }

    @CrossOrigin
    @GetMapping("/getSpecKqPoint")
    public List<specKqPointInfo> getSpecKqPoint(String id) {
        return qkListService.getSpecKqPoint(id);
    }

    @CrossOrigin
    @GetMapping("/getSpecKqJzPoint")
    public List<Map<String, String>> getSpecKqJzPoint(String id) {
        return qkListService.getSpecKqJzPoint(id);
    }

    @CrossOrigin
    @GetMapping("/getSpecKqJcdPoint")
    public List<Map<String, String>> getSpecKqJcdPoint(String id) {
        return qkListService.getSpecKqJcdPoint(id);
    }

    @CrossOrigin
    @GetMapping("/getOverviewView")
    public Map<String, List<Map<String, String>>> getOverviewView(String id) {
        Map<String, List<Map<String, String>>> overviewView = qkListService.getOverviewView(id);
        log.info("overviewView: {}", overviewView);
        return overviewView;
    }

    @CrossOrigin
    @GetMapping("/getSpecJzView")
    public Map<String, List<Map<String, String>>> getSpecJzView(String id, String kqId) {
        return qkListService.getSpecJzView(id, kqId);
    }
}
